package com.noizycat.ver2.view.customListView;

import java.util.ArrayList;

import android.content.Context;
import android.view.View;
import android.widget.ListView;

import com.noizycat.ver2.dto.TweetDto;
import com.noizycat.ver2.view.adaptor.TweetLineAdaptor;

public class CustomListViewObject extends View {

    String viewName = "";
    private ListView mList = null;
    Context mContext = null;
    ArrayList<TweetDto> list = new ArrayList<TweetDto>();
    TweetLineAdaptor adapter;

    Class classIns = TweetDto.class.getClass();

    public CustomListViewObject(Context context, String viewName) {

        super(context);
        this.viewName = viewName;
        this.mContext = context;

        mList = new ListView(mContext);

        adapter = new TweetLineAdaptor(context, 0, list);
        // アイテムを追加します

        mList.setAdapter(adapter);
    }

    public void add(TweetDto item) {

        adapter.insert(item, 0);
        adapter.notifyDataSetChanged();
    }

    public ListView getmList() {

        return mList;
    }

    public void setmList(ListView mList) {

        this.mList = mList;
    }

}
